home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / Skweek.lha / SkweekHD / Install-Skweek next >
Text File  |  2002-01-03  |  4KB  |  195 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")                ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #highs-file "highs")        ;name of high scores file
  6. (set #cleanup "")            ;files to delete after install
  7. (set #last-file "K")            ;last file the imager should create
  8.  
  9. ;****************************
  10. ;----------------------------
  11. ; checks if given program is installed, if not abort install
  12. ; #program - to check
  13.  
  14. (procedure P_ChkRun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort
  19.       (cat
  20.     "You must install \"" #program "\" first!\n"
  21.     "It must be accessible via the path.\n"
  22.     "You can find it in the WHDLoad package."
  23.       )
  24.     )
  25.   )
  26. )
  27.  
  28. ;****************************
  29.  
  30. (if
  31.   (exists #readme-file)
  32.   (if
  33.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  34.     ("")
  35.     (run ("SYS:Utilities/More %s" #readme-file))
  36.   )
  37. )
  38.  
  39. (set #program "WHDLoad")
  40. (P_ChkRun)
  41.  
  42. (set #program "RawDIC")
  43. (P_ChkRun)
  44.  
  45. (if
  46.   (= @user-level 2)
  47.   (
  48.     (set #CI_drive
  49.       (askchoice
  50.     (prompt "Select source drive for diskimages")
  51.     (default 0)
  52.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  53.     (help @askchoice-help)
  54.       )
  55.     )
  56.     (select #CI_drive
  57.       (set #CI_drive "DF0:")
  58.       (set #CI_drive "DF1:")
  59.       (set #CI_drive "DF2:")
  60.       (set #CI_drive "DF3:")
  61.     )
  62.     (set #ignore " IGNOREERRORS")
  63.   )
  64.   (set #CI_drive "DF0:")
  65.   (set #ignore "")
  66. )
  67.  
  68. (if
  69.   (getenv "WHDLInstPath")
  70.   (set @default-dest (getenv "WHDLInstPath"))
  71. )
  72. (set @default-dest
  73.   (askdir
  74.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  75.     (help @askdir-help)
  76.     (default @default-dest)
  77.     (disk)
  78.   )
  79. )
  80. (run ("setenv WHDLInstPath \"%s\"" @default-dest))
  81. (set #dest (tackon @default-dest @app-name))
  82. (if
  83.   (exists #dest)
  84.   (
  85.     (set #choice
  86.       (askbool
  87.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  88.         (default 1)
  89.         (choices "Delete" "Skip")
  90.         (help @askbool-help)
  91.       )
  92.     )
  93.     (if
  94.       (= #choice 1)
  95.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  96.     )
  97.   )
  98. )
  99. (makedir #dest
  100.   (help @makedir-help)
  101.   (infos)
  102. )
  103.  
  104. ;----------------------------
  105.  
  106. (if
  107.   (exists ("%s.newicon" @app-name))
  108.   (set #icon
  109.     (askchoice
  110.       (prompt "\nWhich icon would you like to install?\n")
  111.       (default 0)
  112.       (choices "ColorIcon" "NewIcon" "Frank's GlowIcon")
  113.       (help @askchoice-help)
  114.     )
  115.   )
  116.   (set #icon 0)
  117. )
  118. (select #icon
  119.   (set #icon ("%s.coloricon" @app-name))
  120.   (set #icon ("%s.newicon" @app-name))
  121.   (set #icon ("%s.frank" @app-name))
  122. )
  123. (copyfiles
  124.   (help @copyfiles-help)
  125.   (source #icon)
  126.   (newname ("%s.info" @app-name))
  127.   (dest #dest)
  128. )
  129. (copyfiles
  130.   (help @copyfiles-help)
  131.   (source ("%s.Slave" @app-name ))
  132.   (dest #dest)
  133. )
  134. (if
  135.   (exists #readme-file)
  136.   (copyfiles
  137.     (help @copyfiles-help)
  138.     (source #readme-file)
  139.     (dest #dest)
  140.   )
  141. )
  142. (if
  143.   (exists ("%s.info" #readme-file))
  144.   (
  145.     (copyfiles
  146.       (help @copyfiles-help)
  147.       (source ("%s.info" #readme-file))
  148.       (dest #dest)
  149.     )
  150.     (tooltype
  151.       (dest (tackon #dest #readme-file))
  152.       (noposition)
  153.     )
  154.   )
  155. )
  156. (if
  157.   (= #sub-dir "")
  158.   ("")
  159.   (
  160.     (set #dest (tackon #dest #sub-dir))
  161.     (makedir #dest
  162.       (help @makedir-help)
  163.     )
  164.   )
  165. )
  166. (if
  167.   (exists #highs-file)
  168.   (copyfiles
  169.     (help @copyfiles-help)
  170.     (source #highs-file)
  171.     (dest #dest)
  172.   )
  173. )
  174.  
  175. (copyfiles
  176.   (help @copyfiles-help)
  177.   (source ("%s.islave" @app-name))
  178.   (dest #dest)
  179. )
  180.  
  181. (working)
  182. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  183.  
  184. (if
  185.   (exists (tackon #dest #last-file))
  186.   ("")
  187.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  188. )
  189.  
  190. ;----------------------------
  191.  
  192. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  193.  
  194. (exit)
  195.